/* style.css - 西大留言板样式 */

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

/* 头部样式 */
.header {
    text-align: center;
    margin-bottom: 40px;
    color: white;
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

/* 卡片样式 */
.card {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: bold;
    color: #555;
}

.form-group input[type="text"],
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid #e1e5e9;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.form-group input[type="text"]:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 120px;
}

/* 按钮样式 */
.btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-block;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4);
}

.btn:active {
    transform: translateY(0);
}

/* 表格样式 */
.message-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.message-table th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px;
    text-align: left;
    font-weight: 600;
}

.message-table td {
    padding: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.message-table tr:last-child td {
    border-bottom: none;
}

.message-table tr:hover {
    background-color: #f8f9fa;
}

/* 统计信息 */
.stats {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: white;
}

.stats h2 {
    font-size: 1.5em;
}

/* 分隔线 */
.divider {
    height: 2px;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.5), transparent);
    margin: 30px 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    .header h1 {
        font-size: 2em;
    }

    .card {
        padding: 20px;
    }

    .message-table {
        font-size: 14px;
    }

    .message-table th,
    .message-table td {
        padding: 10px;
    }

    .stats {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* 动画效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.card {
    animation: fadeIn 0.6s ease-out;
}

/* 链接样式 */
.home-link {
    display: inline-block;
    margin-top: 20px;
    color: white;
    text-decoration: none;
    font-size: 16px;
    transition: color 0.3s ease;
}

.home-link:hover {
    color: #ffeb3b;
}

/* 时间戳样式 */
.timestamp {
    color: #666;
    font-size: 0.9em;
}

/* 昵称样式 */
.username {
    color: #667eea;
    font-weight: bold;
}

/* 留言内容样式 */
.message-content {
    line-height: 1.5;
    word-break: break-word;
}

/* 统计卡片样式 */
.stats-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

.stats-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    text-align: center;
}

.stat-item {
    padding: 10px;
}

.stat-number {
    font-size: 2.5em;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
}

.stat-text {
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 5px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.3);
}

.stat-label {
    font-size: 0.9em;
    opacity: 0.9;
}

/* 表格头部样式 */
.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.table-header h2 {
    margin: 0;
    color: #333;
}

.message-count {
    background: #667eea;
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 0.9em;
    font-weight: bold;
}

/* 空状态样式 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.empty-state p {
    font-size: 1.1em;
    margin: 0;
}

/* 响应式设计 - 统计卡片 */
@media (max-width: 768px) {
    .stats-container {
        flex-direction: column;
        gap: 20px;
    }

    .stat-number {
        font-size: 2em;
    }

    .table-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}

/* 动画效果增强 */
.stat-item {
    animation: fadeInUp 0.6s ease-out;
}

.stat-item:nth-child(1) { animation-delay: 0.1s; }
.stat-item:nth-child(2) { animation-delay: 0.2s; }
.stat-item:nth-child(3) { animation-delay: 0.3s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 数据管理样式 */
.data-management {
    text-align: center;
    padding: 20px;
}

.btn-secondary {
    background: linear-gradient(135deg, #28a745 0%, #20c997 100%);
}

.btn-danger {
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
}

.btn-secondary:hover {
    box-shadow: 0 5px 15px rgba(40, 167, 69, 0.4);
}

.btn-danger:hover {
    box-shadow: 0 5px 15px rgba(220, 53, 69, 0.4);
}

/* 成功提示 */
.success-message {
    background: #d4edda;
    color: #155724;
    padding: 12px;
    border-radius: 5px;
    margin: 10px 0;
    border: 1px solid #c3e6cb;
}

/* 错误提示 */
.error-message {
    background: #f8d7da;
    color: #721c24;
    padding: 12px;
    border-radius: 5px;
    margin: 10px 0;
    border: 1px solid #f5c6cb;
}